#include "GraphElementBuilder.h"

namespace util {

GraphElementBuilder::GraphElementBuilder() {

}

GraphElementBuilder::~GraphElementBuilder() {

}

Vertex::Edge* GraphElementBuilder::buildEdge(parser::EdgeParsedData* data,
		Graph &graph) throw (DuplicateElementException,
				ElementNotFoundException) {
	return graph.addEdge(data->getId(), graph.getVertex(data->getIdO()),
			graph.getVertex(data->getIdD()), data->getLength(),
			data->getMaxSpeed());
}

Vertex* GraphElementBuilder::buildVertex(parser::VertexParsedData* data,
		Graph &graph) throw (DuplicateElementException) {
	return graph.addVertex(data->getId(), data->getX(), data->getY());
}

}
